var app = getApp(),
  $ = require("../../utils/httpHelper.js")
Page({
  data: {
    indexArray: [],
    userInfo: {},
    adr_num:'',
    fav_num:'',
    isrz:false
  },
  onLoad: function (e) {
    var that = this;
    this.setData({ userInfo: app.globalData.userInfo })
   
    
  },
  onShow:function(e){
    // $.httpPost("member_index", { rd_session: app.globalData.userInfo.rd_session }, (data, err) => {
    //   this.setData({
    //     adr_num: data.data.address_num,
    //     fav_num: data.data.favorite_num
    //   })
    // })
    let par = {
      rd_session: app.globalData.userInfo.rd_session
    }
    $.httpPost("member_info", par, (data, err) => {
      if (data.data.data.name == null) {
        return
      } else {
        this.setData({
          isrz: true,
        })
      }

    })
  },
  toorder:function(e){
    let id = e.currentTarget.dataset.id
    console.log(e)
    wx.navigateTo({
      url: '/pages/order/order?id='+id,
    })
  },
  tofenxiao(){
    wx.navigateTo({
      url: '/pages/myvault/unfenx',
    })
    // let memberType = app.globalData.userInfo.member_type
    // console.log(memberType)
    // if (memberType == 0 || memberType == 4 || memberType == 6
    //   || memberType == 8 || memberType == 10 || memberType == 12 || memberType == 14
    //   || memberType == 16 || memberType == 18 || memberType == 20 || memberType == 24 
    //   || memberType == 26 || memberType == 28 || memberType == 30 || memberType == 34 
    //   || memberType == 36 ){
    //   wx.navigateTo({
    //     url: '/pages/myvault/unfenx',
    //   })
    // }else{
    //   wx.showToast({
    //     title: '没有权限',
    //   })
    // }
    
  },
  tomineclass(e) {
    let status = e.target.dataset.status
    wx.navigateTo({
      url: '/pages/kecheng/myclass?status=' + status,
    })
  },
  tojifen(){
    wx.navigateTo({
      url: '/pages/integral/integral',
    })
  },
  toyuangong(){
    wx.navigateTo({
      url: '/pages/mine/yuangong',
    })
  },
  tocar() {
    wx.navigateTo({
      url: '/pages/car/car',
    })
  },
  toinfo(){
    wx.navigateTo({
      url: '/pages/mine/info',
    })
  },
  tocolle(){
    wx.navigateTo({
      url: '/pages/mine/colle',
    })
  },
  toadr() {
    wx.navigateTo({
      url: '/pages/address/addressli?adr_num=' + this.data.adr_num,
    })
  },
  tocolle(){
    wx.navigateTo({
      url: '/pages/mine/colle',
    })
  },
  tovip(){
    wx.navigateTo({
      url: '/pages/mine/member',
    })
  },
  
  toabout(){
    wx.navigateTo({
      url: '/pages/yeni/about',
    })
  },

  phone1: function () {
    var that = this;
    wx.makePhoneCall({
      phoneNumber: "17782833823"
    })
  },
  
});